package com.frogs.ucenter.controller;

import java.util.Arrays;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.frogs.framework.base.web.BaseController3;
import com.frogs.ucenter.service.NewsService;

/**
 * 验证检查类
 * @author wushubin
 *
 */
@Controller
public class NewsController extends BaseController3 {

	private static Logger log = LoggerFactory.getLogger(NewsController.class);
    
    @Resource
    private NewsService newsService;
	
	private static final String LIST = "/news/list";
	
	@RequestMapping(LIST)
    public void list(HttpServletRequest request,ModelMap model) throws Exception {
		try{
	    	//新闻列表模块
	    	model.addAttribute("list", newsService.getNewsList());
		} catch (Exception e) {
			log.error("func[list] parameterMap[{}] exception[{} - {}] desc[fail]",
					new Object[] { request.getParameterMap(), e.getMessage(), Arrays.deepToString(e.getStackTrace()) });
		}
	}
}
